# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Fabio Ribeiro <fabiorphp@gmail.com>
pkgname=php7-pecl-oauth
_pkgreal=oauth
pkgver=2.0.5
pkgrel=1
pkgdesc="OAuth is an authorization protocol built on top of HTTP."
url="https://pecl.php.net/package/oauth"
arch="all"
license="BSD-3-Clause"
depends="php7-common"
makedepends="php7-dev autoconf re2c pcre2-dev curl-dev"
source="https://pecl.php.net/get/$_pkgreal-$pkgver.tgz
	pcre.patch"
builddir="$srcdir"/$_pkgreal-$pkgver
provides="php7-oauth=$pkgver-r$pkgrel" # for backward compatibility
replaces="php7-oauth" # for backward compatibility

build() {
	phpize7
	./configure --prefix=/usr --with-php-config=php-config7
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}

package() {
	make INSTALL_ROOT="$pkgdir"/ install
	install -d "$pkgdir"/etc/php7/conf.d
	echo "extension=$_pkgreal.so" > "$pkgdir"/etc/php7/conf.d/60_$_pkgreal.ini
}

sha512sums="847f8a07aba930d606038a78915ddd9c24aab241d27b844a766e0da3caabf419fd891573524a55b40559a827b1adc1261748efabac5ed1bee45fa770935379ee  oauth-2.0.5.tgz
68d636032d2f3cb2822ea3121a80256b87a04cc5998c4775174366c6a3392dfe3abc00c84cc50aca5745a32ddd2246af129fe5aa17cc415652c52214a84feef9  pcre.patch"
